package com.miyuan.view.start;

import android.app.Activity;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;

import com.miyuan.R;
import com.miyuan.base.BaseActivity;
import com.miyuan.net.NetService;
import com.miyuan.utils.SPUtils;
import com.miyuan.view.home.HomeActivity;
import com.miyuan.view.login.LoginControlActivity;

import java.io.IOException;

import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;

/**
 * 启动页
 **/
public class MainActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        setLayout(R.layout.activity_main);
        super.onCreate(savedInstanceState);
        if (null != SPUtils.getInstance().getString("Authorization", null)) {
            startActivity(new Intent(MainActivity.this, HomeActivity.class));
        } else {
            startActivity(new Intent(MainActivity.this, LoginControlActivity.class));
        }
        finish();
    }
}
